<template>
  <div class="student">
    <div class="head">
      <div class="head-left">学员管理</div>
      <div class="head-right">
        <el-button icon="el-icon-user">添加学员</el-button>
        <el-button icon="el-icon-folder-add">添加排课</el-button>
        <el-button icon="el-icon-delete">删除</el-button>
        <div class="form">
          <el-select
            class="sel"
            v-model="ruleForm.region"
            placeholder="请选择活动区域"
          >
            <el-option label="区域一" value="shanghai"></el-option>
            <el-option label="区域二" value="beijing"></el-option>
          </el-select>
          <el-input
            class="imput"
            placeholder="请填写学员姓名"
            v-model="ruleForm.name"
          ></el-input>
        </div>
      </div>
    </div>
    <div class="main">
      <el-table :data="tableData" style="width: 100%">
        <el-table-column type="selection" width="55"></el-table-column>
        <el-table-column prop="name" label="学生姓名" width="180">
          <span class="span-name">
              <img src="../../assets/index-1.png" style="width:30px;height:30px;" alt="">
          </span>
          <span class="span-name">
              张三
          </span>
        </el-table-column>
        <el-table-column prop="sex" label="性别" width="180"></el-table-column>
        <el-table-column prop="birthday" width="180" label="生日">
        </el-table-column>
        <el-table-column prop="age" width="180" label="年龄"> </el-table-column>
        <el-table-column prop="schooldate" width="180" label="入学时间">
        </el-table-column>
        <el-table-column prop="status" width="180" label="状态">
            <el-button type="text" @click="open">流失</el-button>
        </el-table-column>
        <el-table-column prop="hourexpend" width="180" label="课时消耗">
        </el-table-column>
        <el-table-column prop="operation" label="操作">
            <el-button type="text" @click="open">购课</el-button>
            <el-button type="text" @click="open">记录</el-button>
            <el-button type="text" @click="open">修改</el-button>
            <el-button type="text" @click="open">删除</el-button>
            <el-button type="text" @click="open">课表</el-button>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
export default {
  name: "index",
  data() {
    return {
      ruleForm: {
        name: "",
        region: "",
      },
      tableData: [
        {
          name: "王小虎",
          sex: "男",
          birthday: "2000-1-12",
          age: "21",
          schooldate: "2021-07-03 10:28",
          status: "未报名",
          hourexpend: "",
          operation: "",
        },
      ],
    };
  },
  methods: {
      open() {
        this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.$message({
            type: 'success',
            message: '删除成功!'
          });
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          });
        });
      }
  },
};
</script>

<style scoped>
.student {
  margin-left: 2%;
  background-color: #fff;
}
.head {
  height: 46px;
  display: flex;
}
.head .head-left {
  width: 90px;
  line-height: 46px;
  text-align: left;
}
.head .head-right {
  width: 100%;
  background-color: #f1f2f6;
  display: flex;
  justify-content: start;
  align-items: center;
  padding-left: 20px;
}
.el-button {
  font-size: 12px;
  height: 30px;
}
.form {
  width: 365px;
  height: 30px;
  display: flex;
  align-items: center;
}
.sel,
.imput {
  margin-left: 10px;
  width: 50%;
}
.main {
  width: 100%;
  margin-top: 10px;
}
.main .tab {
  background-color: #f5f6fa;
}
.main .span-name {
    margin-left: 5px;
    line-height: 65px;
}
.el-button{
    color: #000;
}
</style>
